package com.kl.airticketserver.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kl.airticketserver.entity.SysDict;
import com.kl.airticketserver.entity.SysDictData;
import com.kl.airticketserver.mapper.SysDictDataMapper;
import com.kl.airticketserver.mapper.SysDictMapper;
import com.kl.airticketserver.service.SysDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> implements SysDictService {
    
    @Autowired
    private SysDictDataMapper dictDataMapper;
    
    @Override
    public List<SysDictData> getDictData(String dictCode) {
        QueryWrapper<SysDictData> wrapper = new QueryWrapper<>();
        wrapper.eq("dict_code", dictCode)
               .eq("status", 1)
               .orderByAsc("sort");
        return dictDataMapper.selectList(wrapper);
    }
}